Some fixes for MTP database corruption

Sometimes the row for a directory could be accidentally deleted,
when they're re-added the children's parent id could still point
to the stale value, so the children were lost.

Do not allow deletion of rows if some other rows are referencing
it as parent. Also, run a query for orphans upon MTP connection,
and try to fix up the parent id if possible.

bug: 27542615
Change-Id: I305dc2f1335888c5d747bed1a7e0f28ac9bb49b4
1 file changed