fixed setting NEED_SAVE flag after migration to thread safe functions
added Ubuntu/Debian package names and fixed a typo