Added checks to ensure provided directory for dump files is valid and correctly formatted

fixed some mistakes
* default dump directory is now CWD if not specified on cmd line
* trailing slash is now added to dump directory if necessary
* dump directory is now checked to actually be a writable directory
* fixed possible crash in case dump thread is canceled and cleanup function is called twice
* fixed possible crash in case dump thread is canceled and remove_flow() is called before dump thread actually terminated
* fixed that uninit_flow() invalidates all existing pointers to flows following the one in question