Correct the logic of the is_protected cache check

We cache the remote GET request used to check whether attachments are protected,
with this cached value being checked before moving on to do the GET request.
The logic that is used to verify whether a cached value has been stored was
backward, however, resulting in some very slow lookups.

Many thanks to @brooks1man for help debugging this issue.

Fixes #422
Readme
Better parsing of submitted bp-docs settings in groups

bp-docs settings include group-enable, which is represented in the markup by
a checkbox. This means that when the checkbox is unchecked, no value for group-
enable shows up in the POST array. As a result, when Docs is disabled for a
group, no value is saved in the settings array. Since the introduction of
bp_docs_get_group_settings() (and its internal default parsing), this has meant
that groups without a value for group-enable incorrectly get Docs turned on.

We fix this by ensuring that all bp_docs_get_group_settings() keys are filled
in saved settings arrays.

Fixes #424
Readme
Bump version numbers to 1.8.2
Add some filters
Improve performance of bp_docs_get_current_doc()

Not really used in the rest of Docs, this makes it better at fetching the
intended Doc
When saving Doc, use bp_docs_get_current_doc() instead of relying on get_queried_object()

This ensures that the value is filterable
Filter the redirect base for after saving a Doc
WHitespace
Correct variable name
Remove switch case regarding the setting of a base URL
Fix logic in bp_docs_is_existing_doc()
Do access protection query at pre_get_posts:28

Firing at priority 10 was causing conflicts with other plugins using the
pre_get_posts hook. Due to a limitation in WP's filter API, calling
remove_filter( $hook ) while in the process of doing $hook will cause other
items hooked to $hook to be removed when those other callbacks are at hooked
at a priority directly adjacent to the original hook. See
https://core.trac.wordpress.org/ticket/17817 for more background on the
limitations of nested remove_action() calls.

Props to @christianwach and @stephenharris for researching the conflict and
suggesting the solution.

Fixes #425
Readme
Encore de filters
Die after redirects
Clean up groups_template global in bp_docs_doc_associated_group_markup()

On single doc pages, the pollution of the $groups_template global by this
function was causing the page to be rendered nearly infinitely on large sites,
because of the bp_has_groups() loop on groups/single/home.php template. By
keeping a backup of the global and replacing it when we're done, we ensure that
this looping does not happen

Yowza
Filter arguments for building parent dropdown
Merge remote-tracking branch 'upstream/1.8.x' into 1.8.x