fix mountpoint / scriptname management

If the mountpoint is /foo or /foo/ then the following URIs should be managed:
* /foo
* /foo/
* /foo/anything

And, on the other side, should be ignored:
* /fooanything
* etc.
add manage_script_name tests
refactor manage_script_name mountpoint selection (readability)
faboulous positioning of logic operators
avoid bad memory access if mountpoint_len equal to 0
Merge pull request #755 from aldur/manage_script_name_fix

manage_script_name fix for tricky resources