tools: add license boilerplate to check-imports.sh

From the commit log:

    I want to use this file in other projects and I don't want there to be
    any misconceptions about its authorship or copyright.

The other commit makes the script a little more general purpose.

Suggested reviewer: @tjfontaine