Store sbt jars within user's home if script_dir is not writable

Store sbt jars within user's home if the `$script_dir` is not writable. We need this to share script across users.

For backward compatibility, no behaviors are changed if `$script_dir/.lib` is writable. Otherwise, use `~/.sbt/launch` as `$script_dir`.