keeping liquidprompt from overriding PROMPT_DIRTRIM when path shortening is disabled
Reset LP_OLD_PWD on startup

Reset the LP_OLD_PWD variable on startup.
This makes debugging easier: previously we had to change directory
after a reload to see the changes of the new code for the PWD-cached
parts.
bash/PROMPT_DIRTRIM: complete rewrite

Complete rewrite of the _lp_get_dirtrim into _lp_set_dirtrim with a much
faster implementation that avoids char by char processing of $PWD.
Also use (( )) builtin.