I know I can use TeX-output-view-style to customize the view
procedure, but how can I insert command "pdfclose" before the standard
compiling procedure with minimal change of the original ones?
You could write an expander for `TeX-command-list' which expands to
`pdfclose' plus arguments when `TeX-PDF-mode' is active and stick that
into the respective `TeX-command-list' entry or add it to
`LaTeX-command-style'. Problem is that `pdfclose' will be called
everytime you compile a file in PDF mode, even though the viewer might
not be open.
An alternative would be to use a better viewer which does not lock the
file. Doesn't the Sumatra PDF viewer do that? (The downside of the
latter is that it does on online update check which cannot be disabled.)