Fix DB crash on negative volume type

Through a bug it was possible for volumes to be inserted to the database
with type == -1. This commit fixes the bug in EDApplication.getFSIndex()
and patches the DBHelper code to drop affected volumes from the
database.