If you use:

    enkf_fs_type * target_fs = enkf_fs_get_ref( enkf_main_get_fs( enkf_main )));

you can unconditionally use 

    enkf_fs_umount( target_fs )

at the end - without needing to keep track of the target_is_current variable.