fix(library): check dir before writing outState

Check whether mSelectedDir was set before saving the directory in
onSaveInstanceState in case that the fragment is detached very quickly.

Fix #20