Fix checking the init script in check.rake

Fixes #2671
Merge up to c84fcb265c on branch '4-0-stable' of https://github.com/gitlabhq/gitlabhq into 4-0-stable