fix bug with --mem-db getting errors when trying to stat drive of non existing file
add check that directory actually exists before calling df