imagex_optimize(), imagex_update(): Check if file writable first