Fix error in instance_get_all_by_filters() use of soft_deleted filter

Commit 0f56d8ddb02f54ae389380dcd0790e55f2dcb479 introduced the use of
a soft_deleted filter to the above db method for use in combination
with the already existing deleted filter. In doing so, an error was
introduced that changed the original behavior of the deleted filter,
when used alone.

This changes it back to retain the original behavior that when setting
the deleted filter alone, it should either include or exclude both
soft- and hard-deleted instances.

Also add unit test coverage to changes to instance_get_all_by_filters()
that was introduced in commit 0f56d8ddb02f54ae389380dcd0790e55f2dcb479.

Resolves bug 1181865.

Change-Id: Ibb82af09d3876904455ca7c93e14e9722ed31d35